package com.base.self.controller.web;


import com.base.result.ResponseResult;
import com.base.self.dto.ptTeam.PtCurrentWebListDTO;
import com.base.self.service.IPtCurrentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.validation.Valid;

@RestController
@Slf4j
@RequestMapping("/admin")
public class PtCurrentWebController {

    private final IPtCurrentService ptCurrentService;

    public PtCurrentWebController(IPtCurrentService ptCurrentService) {
        this.ptCurrentService = ptCurrentService;
    }

    @GetMapping("/ptCurrentIndex")
    public ModelAndView ptCurrentIndex(){
        return new ModelAndView("ptTeam/ptCurrentIndex");
    }

    @PostMapping(value = "/ptCurrentWebList")
    @Validated
    public ResponseResult moneyGoldWebList(@Valid final PtCurrentWebListDTO ptCurrentWebListDTO) {
        return ptCurrentService.selectWebList(ptCurrentWebListDTO);
    }

}
